#Create chart using ggplot tools
Chart_1 <- Turtle %>% ggplot() +
geom_bar(mapping = aes(x = as.Date(Date, "%Y-%m", tz = "UTC"), y = egglaying, group = 2, size = "Eggs Laying"),
stat = "identity", colour = "#2F528F", fill = "#2F528F") +
scale_size_manual(NULL, values = 0.5) +
geom_point(mapping = aes(x = as.Date(Date, "%Y-%m", tz = "UTC"),
y = nharv * 500000/100, group = 1, color = "Nest harvested"), size = 3,
shape = 21, fill = "#ED7D31", inherit.aes = FALSE) +
geom_line(mapping = aes(x = as.Date(Date, "%Y-%m", tz = "UTC"),
y = nharv * 500000/100, group = 1, color = "Nest harvested"), colour="#ED7D31", inherit.aes = FALSE) +
scale_color_manual(NULL, values = "#ED7D31") +
scale_x_date(date_labels = "%b-%Y", date_breaks = "6 months") +
scale_y_continuous(
name = "Egg Laying Females (total number)",
sec.axis = sec_axis(~. * 100/500000, name="Nests Harvested (percent)"),
limits = c(0, 500000)) + xlab("Date") +
ggtitle("Total number of Egg Laying Females and Percent of Nests Harvested
Ostional - Costa Rica, Period 2006-2010") + theme_bw() +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.position="top",
legend.background = element_rect(fill = "transparent"),
legend.box.background = element_rect(fill = "transparent", colour = NA),
legend.key = element_rect(fill = "transparent"),
legend.spacing = unit(-1, "lines"))